.class public final Lnbisdk/da;
.super Landroid/content/BroadcastReceiver;

# interfaces
.implements Lnbisdk/og;


# static fields
.field private static eX:Lnbisdk/da;


# instance fields
.field private eW:Lnbisdk/mt;

.field private eY:Landroid/net/wifi/WifiManager;

.field private eZ:J

.field private mContext:Landroid/content/Context;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    const/4 v0, 0x0

    sput-object v0, Lnbisdk/da;->eX:Lnbisdk/da;

    return-void
.end method

.method private constructor <init>(Landroid/content/Context;)V
    .locals 2

    const/4 v0, 0x0

    invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V

    iput-object v0, p0, Lnbisdk/da;->eW:Lnbisdk/mt;

    iput-object v0, p0, Lnbisdk/da;->mContext:Landroid/content/Context;

    const-wide/16 v0, 0x0

    iput-wide v0, p0, Lnbisdk/da;->eZ:J

    :try_start_0
    iput-object p1, p0, Lnbisdk/da;->mContext:Landroid/content/Context;

    const-string v0, "wifi"

    invoke-virtual {p1, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/net/wifi/WifiManager;

    iput-object v0, p0, Lnbisdk/da;->eY:Landroid/net/wifi/WifiManager;

    new-instance v0, Landroid/content/IntentFilter;

    const-string v1, "android.net.wifi.SCAN_RESULTS"

    invoke-direct {v0, v1}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V

    invoke-virtual {p1, p0, v0}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    return-void

    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method private static a(Ljava/util/Vector;Ljava/lang/String;Ljava/lang/String;)V
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Vector",
            "<",
            "Lnbisdk/of;",
            ">;",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ")V"
        }
    .end annotation

    if-eqz p0, :cond_0

    new-instance v0, Lnbisdk/of;

    invoke-direct {v0, p1, p2}, Lnbisdk/of;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {p0, v0}, Ljava/util/Vector;->addElement(Ljava/lang/Object;)V

    :cond_0
    return-void
.end method

.method public static e(Lcom/nbi/common/NBIContext;)Lnbisdk/da;
    .locals 2

    sget-object v0, Lnbisdk/da;->eX:Lnbisdk/da;

    if-nez v0, :cond_2

    if-nez p0, :cond_0

    const/4 v0, 0x0

    :goto_0
    return-object v0

    :cond_0
    invoke-virtual {p0}, Lcom/nbi/common/NBIContext;->getInternalObject()Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Lnbisdk/bl;

    new-instance v0, Lnbisdk/da;

    invoke-virtual {p0}, Lnbisdk/bl;->jw()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, v1}, Lnbisdk/da;-><init>(Landroid/content/Context;)V

    sput-object v0, Lnbisdk/da;->eX:Lnbisdk/da;

    :cond_1
    :goto_1
    sget-object v0, Lnbisdk/da;->eX:Lnbisdk/da;

    goto :goto_0

    :cond_2
    if-eqz p0, :cond_1

    invoke-virtual {p0}, Lcom/nbi/common/NBIContext;->getInternalObject()Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Lnbisdk/bl;

    sget-object v0, Lnbisdk/da;->eX:Lnbisdk/da;

    invoke-virtual {p0}, Lnbisdk/bl;->jw()Landroid/content/Context;

    move-result-object v1

    iput-object v1, v0, Lnbisdk/da;->mContext:Landroid/content/Context;

    goto :goto_1
.end method


# virtual methods
.method public final a(Lnbisdk/mt;)V
    .locals 1

    const/4 v0, 0x0

    iput-object v0, p0, Lnbisdk/da;->eW:Lnbisdk/mt;

    return-void
.end method

.method public final ct()J
    .locals 2

    iget-wide v0, p0, Lnbisdk/da;->eZ:J

    return-wide v0
.end method

.method public final cu()Z
    .locals 1

    iget-object v0, p0, Lnbisdk/da;->eY:Landroid/net/wifi/WifiManager;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lnbisdk/da;->eY:Landroid/net/wifi/WifiManager;

    invoke-virtual {v0}, Landroid/net/wifi/WifiManager;->isWifiEnabled()Z

    move-result v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Lnbisdk/da;->eY:Landroid/net/wifi/WifiManager;

    invoke-virtual {v0}, Landroid/net/wifi/WifiManager;->startScan()Z

    move-result v0

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public final cv()Ljava/util/Vector;
    .locals 8
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/Vector",
            "<",
            "Lnbisdk/rm;",
            ">;"
        }
    .end annotation

    const/4 v7, 0x1

    iget-object v0, p0, Lnbisdk/da;->eY:Landroid/net/wifi/WifiManager;

    if-eqz v0, :cond_a

    iget-object v0, p0, Lnbisdk/da;->eY:Landroid/net/wifi/WifiManager;

    invoke-virtual {v0}, Landroid/net/wifi/WifiManager;->getScanResults()Ljava/util/List;

    move-result-object v0

    new-instance v1, Ljava/util/Vector;

    invoke-direct {v1}, Ljava/util/Vector;-><init>()V

    if-eqz v0, :cond_9

    invoke-interface {v0}, Ljava/util/List;->isEmpty()Z

    move-result v2

    if-nez v2, :cond_9

    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :cond_0
    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_9

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Landroid/net/wifi/ScanResult;

    iget-object v2, p0, Landroid/net/wifi/ScanResult;->capabilities:Ljava/lang/String;

    const-string v3, "[IBSS]"

    invoke-virtual {v2, v3}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v2

    if-nez v2, :cond_0

    new-instance v2, Lnbisdk/rm;

    invoke-direct {v2}, Lnbisdk/rm;-><init>()V

    new-instance v3, Ljava/util/Vector;

    invoke-direct {v3}, Ljava/util/Vector;-><init>()V

    iget-object v4, p0, Landroid/net/wifi/ScanResult;->BSSID:Ljava/lang/String;

    invoke-virtual {v2, v4}, Lnbisdk/rm;->aL(Ljava/lang/String;)V

    iget v4, p0, Landroid/net/wifi/ScanResult;->level:I

    invoke-virtual {v2, v4}, Lnbisdk/rm;->bq(I)V

    iget-object v4, p0, Landroid/net/wifi/ScanResult;->capabilities:Ljava/lang/String;

    invoke-virtual {v4}, Ljava/lang/String;->length()I

    move-result v5

    if-nez v5, :cond_2

    const-string v4, "authentication"

    const-string v5, "OPEN"

    invoke-static {v3, v4, v5}, Lnbisdk/da;->a(Ljava/util/Vector;Ljava/lang/String;Ljava/lang/String;)V

    :cond_1
    :goto_1
    invoke-virtual {v1, v2}, Ljava/util/Vector;->add(Ljava/lang/Object;)Z

    goto :goto_0

    :cond_2
    const-string v5, "WEP"

    invoke-virtual {v4, v5}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v5

    if-ne v5, v7, :cond_3

    const-string v5, "authentication"

    const-string v6, "WEP"

    invoke-static {v3, v5, v6}, Lnbisdk/da;->a(Ljava/util/Vector;Ljava/lang/String;Ljava/lang/String;)V

    :cond_3
    const-string v5, "WPA-EAP"

    invoke-virtual {v4, v5}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v5

    if-ne v5, v7, :cond_4

    const-string v5, "authentication"

    const-string v6, "WPA_ENTERPRISE"

    invoke-static {v3, v5, v6}, Lnbisdk/da;->a(Ljava/util/Vector;Ljava/lang/String;Ljava/lang/String;)V

    :cond_4
    const-string v5, "WPA2-EAP"

    invoke-virtual {v4, v5}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v5

    if-ne v5, v7, :cond_5

    const-string v5, "authentication"

    const-string v6, "WPA2_ENTERPRISE"

    invoke-static {v3, v5, v6}, Lnbisdk/da;->a(Ljava/util/Vector;Ljava/lang/String;Ljava/lang/String;)V

    :cond_5
    const-string v5, "WPA-PSK"

    invoke-virtual {v4, v5}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v5

    if-ne v5, v7, :cond_6

    const-string v5, "authentication"

    const-string v6, "WPA_PSK"

    invoke-static {v3, v5, v6}, Lnbisdk/da;->a(Ljava/util/Vector;Ljava/lang/String;Ljava/lang/String;)V

    :cond_6
    const-string v5, "WPA2-PSK"

    invoke-virtual {v4, v5}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v5

    if-ne v5, v7, :cond_7

    const-string v5, "authentication"

    const-string v6, "WPA2_PSK"

    invoke-static {v3, v5, v6}, Lnbisdk/da;->a(Ljava/util/Vector;Ljava/lang/String;Ljava/lang/String;)V

    :cond_7
    const-string v5, "CCMP"

    invoke-virtual {v4, v5}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v5

    if-ne v5, v7, :cond_8

    const-string v5, "cipher"

    const-string v6, "CCMP"

    invoke-static {v3, v5, v6}, Lnbisdk/da;->a(Ljava/util/Vector;Ljava/lang/String;Ljava/lang/String;)V

    :cond_8
    const-string v5, "TKIP"

    invoke-virtual {v4, v5}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v4

    if-ne v4, v7, :cond_1

    const-string v4, "cipher"

    const-string v5, "TKIP"

    invoke-static {v3, v4, v5}, Lnbisdk/da;->a(Ljava/util/Vector;Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_1

    :cond_9
    move-object v0, v1

    :goto_2
    return-object v0

    :cond_a
    const/4 v0, 0x0

    goto :goto_2
.end method

.method protected final finalize()V
    .locals 1

    iget-object v0, p0, Lnbisdk/da;->mContext:Landroid/content/Context;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lnbisdk/da;->mContext:Landroid/content/Context;

    invoke-virtual {v0, p0}, Landroid/content/Context;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V

    :cond_0
    return-void
.end method

.method public final getWifiState()I
    .locals 2

    const/4 v1, 0x4

    iget-object v0, p0, Lnbisdk/da;->eY:Landroid/net/wifi/WifiManager;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lnbisdk/da;->eY:Landroid/net/wifi/WifiManager;

    invoke-virtual {v0}, Landroid/net/wifi/WifiManager;->getWifiState()I

    move-result v0

    packed-switch v0, :pswitch_data_0

    move v0, v1

    :goto_0
    return v0

    :pswitch_0
    const/4 v0, 0x0

    goto :goto_0

    :pswitch_1
    const/4 v0, 0x1

    goto :goto_0

    :pswitch_2
    const/4 v0, 0x2

    goto :goto_0

    :pswitch_3
    const/4 v0, 0x3

    goto :goto_0

    :cond_0
    move v0, v1

    goto :goto_0

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_1
        :pswitch_0
        :pswitch_3
        :pswitch_2
    .end packed-switch
.end method

.method public final onReceive(Landroid/content/Context;Landroid/content/Intent;)V
    .locals 2

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    iput-wide v0, p0, Lnbisdk/da;->eZ:J

    iget-object v0, p0, Lnbisdk/da;->eW:Lnbisdk/mt;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lnbisdk/da;->eW:Lnbisdk/mt;

    invoke-virtual {v0}, Lnbisdk/mt;->fz()V

    :cond_0
    return-void
.end method
